@import "../../../style/default";

// Main Nav
$nav-prefix-cls: nav;
$nav-icon-width: 14px;
.#{$nav-prefix-cls} {
  display: block;
  font-size: $aside-nav-fs;
  padding: 0;

  > li {
    position: relative;
    //border-left: 3px solid transparent;
    transition: border-left-color 0.4s ease;
    list-style: none;

    > a {
      color: $aside-nav-text-color;
      text-decoration: none;
      padding: ($aside-nav-padding-top-bottom + 6px) $layout-gutter * 2;
      white-space: nowrap;
      position: relative;
      display: block;
      user-select: none;
      font-size: 14px;
      padding-left: ($layout-gutter * 4) - 2px;

      i {
        min-width: $nav-icon-width;
        display: inline-block;
        margin-right: $layout-gutter;
        transition: font-size 0.15s $ease-out, margin 0.3s $ease-in-out;
        vertical-align: middle;
      }

      .nav-icon {
        $fix-aside-icon-top: (
          (
              ($aside-nav-fs * $line-height-base) +
                ($aside-nav-padding-top-bottom * 2)
            ) - 10
        ) / 2;
        position: absolute;
        right: $layout-gutter * 2;
        top: $fix-aside-icon-top;
        font-size: 12px;
        margin: 0;
        color: $aside-nav-selected-text-color;
        transition: transform .3s, -webkit-transform .3s;
      }

      .nav-icon-trans {
        transform: rotate(180deg);
      }

      > span {
        transition: opacity 0.3s $ease-in-out, width 0.3s $ease-in-out;
        opacity: 1;
        color: $aside-nav-selected-text-color;
      }

      &:hover {
        //color: $aside-nav-text-hover-color;
        background: $aside-nav-selected-bg-h-color;
      }
    }

    &.#{$nav-prefix-cls}-group-title {
      color: $aside-nav-group-text-color;
      padding: $aside-nav-padding-top-bottom $layout-gutter * 2;
      font-weight: 700;
      font-size: $font-size-base + 2;
    }

    // Badge
    .badge {
      position: absolute;
      right: $layout-gutter * 2;
      $badge-height: $layout-gutter * 2;

      &:not(.badge-dot) {
        top: ($aside-nav-item-height - $badge-height) / 2;
        height: $badge-height;
        width: $badge-height;
        line-height: $badge-height;
        padding: 0;
        overflow: hidden;
      }

      &-dot {
        top: ($aside-nav-item-height - $layout-gutter) / 2;
      }
    }

    // Selected
    &.#{$nav-prefix-cls}-item-selected {
      border-left-color: $aside-nav-selected-text-color;
      background-color: $aside-nav-selected-bg;

      > a {
        color: $aside-nav-selected-text-color;
        background: $aside-nav-selected-bg-color;
      }
    }

    // Actives
    // Open Submenu
    &.#{$nav-prefix-cls}-submenu-open {
      > .#{$nav-prefix-cls}-sub-title {
        &:after {
          transform: rotate(180deg) scale(0.75);
        }
      }

      > .nav-sub {
        display: block;
        animation: fadeIn 0.5s;
      }
    }

    &.#{$nav-prefix-cls}-dept-bg {
      > a {
        background: $aside-nav-dept-bg-color;
        font-weight: 400;
      }
    }
  }

  &-sub {
    &-title {
      //$fix-aside-icon-top: (
      //    (
      //        ($aside-nav-fs * $line-height-base) +
      //          ($aside-nav-padding-top-bottom * 2)
      //      ) - 18
      //  ) / 2;
      //&:after {
      //  content: '\E61D';
      //  font-family: $iconfont-css-prefix !important;
      //  font-style: normal;
      //  vertical-align: baseline;
      //  text-align: center;
      //  text-transform: none;
      //  text-rendering: auto;
      //  position: absolute;
      //  right: $layout-gutter * 2;
      //  top: $fix-aside-icon-top;
      //  display: inline-block;
      //  font-size: 12px;
      //  transform: scale(0.66666667) rotate(0deg);
      //  transition: transform 0.3s $ease-in-out;
      //  zoom: 1;
      //}
    }

    display: none;
    overflow: hidden;

    > li {
      border-left: 0 !important;
    }
  }

  // Dept
  &-depth1 {
    > li > a {
      //padding-left: ($layout-gutter * 3) + $nav-icon-width + 20px;
      padding-left: ($layout-gutter * 4.75) + $nav-icon-width;
      padding-top: $aside-nav-padding-top-bottom + 3px;
      padding-bottom: $aside-nav-padding-top-bottom + 3px;
      font-size: 12px;
      width: 190px;
      margin-right: 30px;
    }

    .nav-child1 {
      //display: flex;
      //justify-content: space-between;
      &:hover {
        .nav-pushpin {
          display: block;
        }
      }
    }

    .nav-pushpin {
      display: none;
      position: absolute;
      top: 0;
      right: 0;
      width: 30px;
      padding: 7px 3px;
      .nav-pushpin-span {
        width: 16px;
        height: 16px;
        display: block;
        position: absolute;
        cursor: pointer;
        z-index: 10;
      }
      //i {
      //
      //}
      &.active {
        i {
          color: #3f51b5;
          transform: rotate(-45deg);
        }
      }
    }
  }

  &-depth2 {
    > li > a {
      padding-left: ($layout-gutter * 4) + $nav-icon-width;
    }
  }

  &-depth3 {
    > li > a {
      padding-left: ($layout-gutter * 5) + $nav-icon-width;
    }
  }

  // Floating
  &-floating {
    position: absolute;
    z-index: $zindex + 7;
    min-width: 160px;
    border: 1px solid $content-heading-border;
    background-color: $aside-bg;
    border-radius: 4px;
    display: none;

    > li {
      a {
        padding-left: $layout-gutter * 2;
      }
    }

    .nav-child1 {
      a {
        width: 140px;
      }
    }

    &-show {
      display: block;
    }

    .#{$nav-prefix-cls}-sub {
      display: block;
    }

    .#{$nav-prefix-cls}-sub-title::after {
      display: none;
    }

    // Dept
    .#{$nav-prefix-cls}-depth2 {
      > li > a {
        padding-left: $layout-gutter * 3;
      }
    }

    .#{$nav-prefix-cls}-depth3 {
      > li > a {
        padding-left: $layout-gutter * 4;
      }
    }
  }

  .sidebar-nav-query {
    padding: 0 20px;
    text-align: center;
    border: 0;
    background: #fff;
    z-index: 1;
    width: 219px;
    //margin-bottom: 16px;
  }
}

$user-block-width: $aside-wd - ($layout-gutter * 6);
$user-block-avatar-hw: $avatar-size-lg;
.user-block {
  padding-top: ($layout-gutter * 3);
  margin: 0 auto;
  display: block !important;
  width: $user-block-width;
  cursor: pointer;

  .user-block-dropdown {
    display: flex;
    align-items: center;
  }

  .info {
    color: $text-color;
    width: $user-block-width - $user-block-avatar-hw - $layout-gutter;
  }

  .avatar {
    margin-right: $layout-gutter;
  }
}

.apes-input-affix-wrapper {
  font-size: 14px;
}

.apes-input-affix-wrapper .apes-input-prefix {
  img {
    width: 16px;
    height: 16px;
  }

  color: #666;
  top: 52%;
}

.apes-input-affix-wrapper .apes-input-suffix {
  img {
    width: 16px;
    height: 16px;
  }

  color: $primary-color;
  top: 52%;
}

.fn-sidebar-input {
  //letter-spacing: 2px;
  border-radius: 4px;
  border: 1px solid rgba(221, 221, 221, 1);
  font-size: 14px;
  height: 36px;
  color: #666 !important;

  &:hover {
    border-color: #999 !important;
  }

  &:focus, &:checked {
    border-color: #333 !important;
  }
}


// Desktop
@media (max-width: $screen-md-min) {
  .aside-collapsed {
    .fn-aside {
      width: $aside-collapsed-wd;
    }

    .#{$nav-prefix-cls}:not(.#{$nav-prefix-cls}-sub) {
      > li {
        border: none;

        &.#{$nav-prefix-cls}-group-title {
          display: none;
        }

        > a {
          text-align: center;
          padding: ($layout-gutter * 3) 0;

          i {
            margin-right: 0;
            font-size: $aside-nav-collapsed-fs;
          }

          > span {
            max-width: 0;
            display: inline-block;
            opacity: 0;
          }
        }
      }
    }

    .#{$nav-prefix-cls} {
      &-sub {
        display: none !important;

        &-title {
          &:after {
            display: none;
          }
        }
      }
    }

    .user-block {
      width: $aside-collapsed-wd;

      .info {
        display: none;
      }

      .avatar {
        margin: 0 auto;
      }
    }

    .nav-loading {
      left: 18%;
    }
  }
}

.sidebar-nav-list-content {
  list-style: none;
  font-size: 14px;
  max-width: 38vw;
  min-width: 38vw;
  margin: 0;
  padding: 0;
  line-height: 2;

  .sidebar-nav-content-level3 {
    position: relative;
    padding-bottom: 10px;
    margin-left: 105px;

    .sidebar-nav-content-title {
      position: absolute;
      left: -126px;
      width: 120px;
      //padding: 6px 0;
      line-height: 1;
      text-align: right;

      span {
        display: inline-block;
        height: 28px;
        padding: 8px;
        font-weight: 700;
        border-radius: 4px;
      }
    }

    .sidebar-nav-content-list {
      .sidebar-nav-content-link {
        //border-left: 1px solid #e0e0e0;
        &:hover {
          > a {
            color: $aside-menu-text-hover-color;
            background: $aside-menu-con-selected-bg-color;
          }
        }

        > a {
          padding: 8px;
          height: 28px;
          color: $aside-menu-text-color;
          border-radius: 4px;
          line-height: 1;
          display: inline-block;
          white-space: nowrap;
        }
      }
    }
  }

  .sidebar-nav-content-level2 {
    position: relative;
    padding-bottom: 10px;

    .sidebar-nav-content-list {
      .sidebar-nav-content-link {
        padding: 0 8px;
        height: 16px;
        line-height: 16px;
        display: inline-block;
        white-space: nowrap;

        &:hover {
          > a {
            color: $aside-menu-text-hover-color;
            background: $aside-menu-con-selected-bg-color;
          }
        }
      }
    }
  }

  .sidebar-nav-content-selected {
    .sidebar-nav-content-title {
      span {
        color: $aside-menu-text-hover-color;
        background: $aside-menu-con-selected-bg-color;
      }
    }

    .sidebar-nav-content-link-selected {
      > a {
        color: $aside-menu-text-hover-color;
        background: $aside-menu-con-selected-bg-color;
      }
    }
  }

}

.sidebar-nav-query-content-box {
  list-style: none;
  font-size: 14px;
  //margin: 0;
  line-height: 2;
  padding: 0;
  min-height: 400px;
  max-height: 800px;
  //overflow-y: auto;
  margin-top: 12px;
  margin-bottom: 12px;
  margin-right: 4px;
  overflow: hidden;

  &:hover {
    overflow-y: auto;
  }

  .sidebar-nav-query-content-box-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    height: 36px;
    line-height: 36px;
    font-weight: 600;
    color: #333;
    padding: 0px 10px;
  }

  .sidebar-nav-query-content {
    list-style: none;
    padding: 0;

    .sidebar-nav-query-content-link {
      padding: 0 10px 0 30px;
      height: 36px;
      line-height: 36px;
      color: #666;

      &:hover {
        background-color: $aside-nav-selected-bg-h-color;
      }

      > a {
        color: #666;
        display: inline-block;
        width: 100%;
        height: 100%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      > a:hover {
        color: #333;
        font-weight: 400;
      }
    }
  }

}

.sidebar-nav-query-content-box::-webkit-scrollbar { /*滚动条整体样式*/
  scrollbar-highlight-color: #999;
  width: 6px;
  background: transparent;
  -webkit-box-shadow: none;
  border-radius: 6px;
  opacity: 0.5;
}

.sidebar-nav-query-content-box::-webkit-scrollbar-track { /*滚动条里面轨道*/
  -webkit-box-shadow: none;
  background: transparent;
}

.sidebar-nav-query-content-box::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
}

.sidebar-nav-query-content-box::-webkit-scrollbar-track-piece {
  background: transparent;
}

.sidebar-nav-list {
  .apes-popover-content {
    .apes-popover-arrow {
      display: none;
    }

    .apes-popover-inner {
      position: fixed;
      top: 132px;
      left: 20px;
      width: 180px;
      box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.2);
      border-radius: $aside-menu-pop-inner-border-radius;

      .apes-popover-inner-content {
        z-index: 1000;
        padding: 0;
      }
    }
  }
}

.aside-collapsed ~ .cdk-overlay-container {
  .sidebar-menu-list {
    .apes-popover-content {
      .apes-popover-arrow {
        //left: $aside-menu-collapsed-arrow-left;
        display: none;
      }

      .apes-popover-inner {
        left: $aside-menu-collapsed-inner-left;
      }
    }
  }
}

@media (max-height: 800px) {
  .sidebar-nav-query-content-box {
    min-height: 300px;
    max-height: 400px;
  }
}


// Under pad
@media (max-width: $screen-sm-max) {
  .fn-aside,
  .fn-content {
    transition: transform 0.3s ease;
    //margin: 80px 0 0 0 !important;
  }

  .fn-content {
    transform: translate3d($aside-wd, 0, 0);
    //margin: 80px 0 0 0 !important;
    .apes-form-container {
      top: 0;
      padding: 0 !important;
    }
  }

  .aside-collapsed {
    .fn-aside {
      transform: translate3d(-100%, 0, 0);
    }

    .fn-content {
      transform: translateZ(0);
      //margin: 80px 0 0 0 !important;
    }
  }

}

.nav-loading {
  position: absolute;
  top: 45%;
  left: 38%;

  .k-ball7a {
    border: 0;
    margin: 0;
    width: 16px;
    height: 16px;
    position: absolute;
    border-radius: 50%;
    animation: k-loadingO 2s ease infinite;
    //background: #19a68c;
    background: #00a09d;
    animation-delay: -1.5s
  }

  .k-ball7b {
    border: 0;
    margin: 0;
    width: 16px;
    height: 16px;
    position: absolute;
    border-radius: 50%;
    animation: k-loadingO 2s ease infinite;
    //background: #f63d3a;
    background: #008784;
    animation-delay: -1s
  }

  .k-ball7c {
    border: 0;
    margin: 0;
    width: 16px;
    height: 16px;
    position: absolute;
    border-radius: 50%;
    animation: k-loadingO 2s ease infinite;
    //background: #fda543;
    background: #006361;
    animation-delay: -0.5s
  }

  .k-ball7d {
    border: 0;
    margin: 0;
    width: 16px;
    height: 16px;
    position: absolute;
    border-radius: 50%;
    animation: k-loadingO 2s ease infinite;
    //background: #193b48;
    background: #003a39;
  }
}

.no-permission {
  text-align: center;
  font-size: 16px;
  color: #008784;
}

@keyframes k-loadingO {
  0%, 100% {
    transform: translate(0)
  }
  25% {
    transform: translate(160%)
  }
  50% {
    transform: translate(160%, 160%)
  }
  75% {
    transform: translate(0, 160%)
  }
}

.fn-wrapper {
  .fn-aside {
    .sidebar-nav-query {
      position: absolute;
    }
  }
}

